import request from "@/utils/request";

// 会话消息列表
export const listChatMessage = (data) => {
    return request({
        url: '/app/chat/message/list',
        method: 'get',
        params: data
    })
}

// 新增消息，chatId为空时，会创建会话
export const addChatMessage = ({id, chatId, model, prompt, reply}) => {
    return request({
        url: '/app/chat/message',
        method: 'post',
        data: {
            id: id,
            chatId: chatId,
            model: model,
            prompt: prompt,
            reply: reply
        }
    })
}

// 记录重新生成的回答
export const retryChatMessage = ({id, model, reply}) => {
    return request({
        url: '/app/chat/message/retry',
        method: 'put',
        data: {
            id: id,
            model: model,
            reply: reply
        }
    })
}